package router

import (
	"api-gateway/midderware"
	"api-gateway/untils"
	"github.com/gin-gonic/gin"
)

func Router() *gin.Engine {
	//加载日志中间件
	logger, _ := untils.SetUpLogger()
	r := gin.Default()
	r.Use(midderware.Cors())
	r.Use(midderware.LoggerMiddleware(logger))
	v1 := r.Group("/v1")
	{
		UserRouter(v1)         //用户路由
		BrandRouter(v1)        //品牌路由
		EquipmentRouter(v1)    //设备路由
		HealthDataRouter(v1)   //用户数据路由
		UploadRouter(v1)       //上传文件路由
		AlipayRouter(v1)       //支付宝路由
		HealthDoctorRouter(v1) //健康医生路由
		DataReporting(v1)      //健康数据路由
		InstrumentRouter(v1)   //仪器路由
		AddressRouter(v1)      //收货地址路由
		GoodsWelcomeSearch(v1) //商品搜索路由
		HotSearchRouter(v1)    //热度搜索路由
		CarouselRouter(v1)     //轮播图路由
		MinioRouter(v1)        //minio图片上传
		OrderRouter(v1)        //订单路由
		GoodsRouter(v1)        //商品路由
		ShopCarRouter(v1)      //购物车路由
		GroupPing(v1)          //拼团路由
		CutPrice(v1)           //砍价路由
		Distribution(v1)       //二级分销路由
		InAppInfo(v1)          // 站内信
		Seckill(v1)            //秒杀路由
		Invoice(v1)            //发票路由
		FaceIdRouter(v1)       //面容ID路由
	}
	return r
}
